<template>
  <div  class="container">
  <div style="margin-bottom: 50px;font-size: 16px">注销用户信息</div>
  <el-table
    :data="tableList"
    style="width: 100%"
    header-cell-class-name="header-cell-class-name"
    stripe
    border
  >
    <el-table-column prop="coding" label="编号" align="center">
    </el-table-column>

    <el-table-column prop="companyName" label="企业名称" align="center">
    </el-table-column>

    <el-table-column prop="account"  label="用户名" align="center">
    </el-table-column>

    <el-table-column prop="result1" label="状态" align="center">
    </el-table-column>

    <el-table-column  prop="createTime"   label="创建时间" align="center">
      <template slot-scope="{ row }">
        <div>
          {{ row.createTime | filtersTimes }}
        </div>
      </template>
    </el-table-column>

    <el-table-column
        prop="loginTime"
        label="最近登录时间"
        align="center"
    >
      <template slot-scope="{ row }">
        <div>
          {{ row.loginTime | filtersTimes  }}
        </div>
      </template>
    </el-table-column>

    <el-table-column label="操作" align="center">
      <template slot-scope="{ row }">
        <el-button type="primary" size="small" @click="hkClickEdit(row)"
        >查看</el-button
        >
      </template>
    </el-table-column>
  </el-table>
    <div class="pagination-box">
      <el-pagination
        @size-change="handleChanges"
        @current-change="handChanges"
        :current-page="pageParams.page"
        :page-sizes="[20, 50, 100]"
        :page-size="pageParams.count"
        :total="total"
        layout=" prev, pager, next,sizes,jumper"
      >
      </el-pagination>
    </div>
  </div>
</template>
<script>
import {mapGetters} from "vuex"
import { hkGetTimeFmt } from '@/utils/tools'
import { cancellationList } from '@/api/user'
export  default {
  components: {},
  computed: {
    ...mapGetters(["userInfo"])
  },
  watch: {},
  data() {
    return {
      tableList: [],
      type01:{
      "1":"申请中","2":"已通过","3":"审核失败"
      },
      type02:[
        "xxx",
        "申请中",
        "已通过",
        "审核失败"
      ],
      total: 0,
      pageParams: {
        page: 1,
        direction: 0,
        count: 20,
        account: "",
        role: "",
        companyName: ""
      },
    }
  },
  methods: {
    hkClickEdit(row) {
      this.$router.push({path:"/account/user/cancel",query:row});

    },
    async cancellationList() {
      let page = 1
      let direction = 1
      let count = 20
      let res = await cancellationList({ page, count });
      //将接口的数据赋值给tableList
      this.tableList = res.data.data.map(item=>{
        return{...item,result1:this.type02[item.result]}
      });
    },

    handleChanges() {},
    handChanges() {},

  },

  created() {
    this.cancellationList()

  },
  filters: {
    filtersRoleName(val) {
      return (
        options.find(item => {
          return item.value == val;
        }).label || "未知"
      );
    },
    filtersTimes(val) {
      return hkGetTimeFmt(val);
    }
  },
}
</script>
<style>



</style>
